package com.socialcoco.serviceImpl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.socialcoco.entity.Comment;
import com.socialcoco.entity.DiaryImage;
import com.socialcoco.entity.DiaryRespone;
import com.socialcoco.entity.User;
import com.socialcoco.mapper.DiaryImageMapper;
import com.socialcoco.mapper.DiaryResMapper;
import com.socialcoco.service.DiaryImageService;
import com.socialcoco.service.DiaryResService;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;
@Slf4j
@Service
public class DiaryResServiceImpl extends ServiceImpl<DiaryResMapper, DiaryRespone> implements DiaryResService {
    @Autowired
    private DiaryResMapper diaryResMapper;



//    @Cacheable(cacheNames = "listDiary")
    public List<DiaryRespone> listDiary(){
        log.info("进来吗");
        return diaryResMapper.listDiary();
    }
//    @Cacheable(cacheNames = "listDiary",key = "#uid")
    public List<DiaryRespone> listMyDiary(int uid){
        return diaryResMapper.listMyDiary(uid);
    }
    public List<Comment> listComment(int did){
        return diaryResMapper.listComment(did);
    }
    public List<User> listFriend(int uid){
        return diaryResMapper.listFriend(uid);
    }
    public int like(int uid){
        return diaryResMapper.like(uid);
    }
    public List<DiaryRespone> rankList(){
        return diaryResMapper.rankList();
    }
}
